]>
Commit | Line | Data |
---|---|---|
54bf965f P |
1 | IDENTIFICATION DIVISION |
2 | PROGRAM-ID ChargeInEMfield | |
3 | VERSION 20240116 | |
4 | COMMENT A mass m with charge q>0 is located in a static electro-magnetic field [0,0,E], [0,-B,0]. | |
5 | COMMENT Find the trajetory | |
6 | COMMENT Differential equation (Lorentz force): x'' = omega*z', z'' = a*omega^2 - omega*x' | |
7 | COMMENT good start settings are omega=0,92, a*omega^2=0,05 | |
8 | ||
9 | ENVIRONMENT DIVISION | |
10 | ENGINE Anabrid-THAT | |
f25252dd | 11 | TIMEBASE 1ms # corresponds to 1s |
54bf965f P |
12 | REQUIRES INTEGRATOR 4 |
13 | REQUIRES INVERTER 1 | |
14 | REQUIRES COEFFICIENT 3 | |
15 | ||
16 | DATA DIVISION | |
17 | OUTPUT OUTPUT.X x | |
18 | OUTPUT OUTPUT.Z z | |
19 | ||
20 | PROGRAM DIVISION | |
21 | x'' -> INTEGRATOR.1 -> -x' | |
22 | -x' -> INTEGRATOR.2 -> x | |
23 | -x' -> COEFFICIENT.6 -> -omega*x' | |
24 | +1 -> COEFFICIENT.7 -> a*omega^2 | |
25 | a*omega^2, -omega*x' -> INTEGRATOR.4 -> -z' # input is z'' | |
26 | -z' -> INTEGRATOR.5 -> z | |
27 | -z' -> INVERTER.1 -> z' | |
28 | z' -> COEFFICIENT.5 -> omega*z' = x'' | |
29 | ||
30 | OPERATION DIVISION | |
31 | MODE REPEAT | |
32 | OP-TIME 0,21ms |